﻿using System;
using System.Collections.Generic;
using Contracts.Entities;

namespace Model.MovieElements
{
    public class ReadMovieElements
    {
        private MovieDatabaseEntities entities;

        public ReadMovieElements()
        {
            this.entities = new MovieDatabaseEntities();
        }

        public void ReadActors()
        {
            OnCompleted(ActorConverter.GetElements(entities.Actors));
        }

        public void ReadDirectors()
        {
            OnCompleted(DirectorConverter.GetElements(entities.Directors));
        }

        public void ReadGenres()
        {
            OnCompleted(GenreConverter.GetElements(entities.Genres));
        }

        public void ReadCountries()
        {
            OnCompleted(CountryConverter.GetElements(entities.Countries));
        }

        public void ReadStudios()
        {
            OnCompleted(StudioConverter.GetElements(entities.Studios));
        }

        public event Action<IEnumerable<MovieElement>> OnCompleted;

    }
}
